package com.springboot.controller;

import com.springboot.metrics.CounterService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.micrometer.core.instrument.MeterRegistry;

@RestController
@RequestMapping("test/metric")
public class MetricsCounterController {
    
    @Autowired
    CounterService CounterService;

    @Autowired
    private MeterRegistry MeterRegistry;

    // @GetMapping
    // public String hello(){
    //     return "hi";
    // }

    @GetMapping
    public String testCounter(){
        // CounterService.counter("count", "test", "test");
        MeterRegistry.summary("customer.request.count").record(1);;
        return "SUCCESSS";
    }
}
